<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>Insert title here</title>
	<script type="text/javascript">
		//butnList   colId  type  jsUrl   panelTitle  prefix 
		$(function(){
			
		});
		function upSubmit(){
			if(document.getElementById("file").value.length==0)
			{
				$.messager.alert("提示信息","请输入图片地址!","info");
				return false;
			}
			if($('#name').val() ==''){
				$.messager.alert("提示信息","请输入图片名!","info");
				$('#name').focus();
				return false;
			}
			if($('#describe').val() ==''){
				$.messager.alert("提示信息","请输入图片描述!","info");
				$('#describe').focus();
				return false;
			}
			return true;
		}
	</script>
	
</head>
<body>
	<div><input type="button" value="确定" onclick="sureImg('${pageContext.request.contextPath}')"/>
			&nbsp;&nbsp;<input type="button" value="关闭" onclick="closePage(this)"/>
	    	<font color="GREEN">支持JPG,JPEG,GIF,BMP,PNG文件的上传</font><span id="msg" style="float: left;">&nbsp;</span>
			<form action="${pageContext.request.contextPath}/model/upload/upload.jsp?pkValue=${pkValue}&dsId=${dsId}&clnName=${clnName}" 
				id="form1" name="form1" encType="multipart/form-data"  
				onsubmit="return upSubmit()"  method="post" target="hidden_frame" >      
		    	<input type="file" id="file" name="file" style="width:450">      
		    	文件名:<input id="name" name="name"/>
		    	描述:<input id="describe" name="describe"/>     
		    	<INPUT type="submit" value="上传文件"><span id="msg"></span>
		    	<br>
		    </form>
		   	<iframe name='hidden_frame' id="hidden_frame" style='display:none'></iframe> 
	</div>
	
	<div id='imageArea' style="padding-top: 10px;">
		<c:forEach items="${imgs}" var="img" varStatus="count" >
			<div style="float: left; width: 163px;">
				<div>
					<img  for="img${count.index}" width="159" height="216" alt="${img.NAME}" src="${pageContext.request.contextPath}${img.PATH}">
				</div>
				<div>
					<font class='nameSty'>${img.NAME}</font>
				</div>
				<div>
					<font class='desSty'>${img.DESCRIBE}</font>
				</div>
				<div>
					<input type="radio" id='img${count.index}' name="default" title="设为默认" value="${img.PATH}"><label style="cursor: pointer;" for="img${count.index}">设为默认</label>
				</div>
			</div>
		</c:forEach>
	</div>
</body>
</html>